package org.budo.phone.api;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * 基类
 * 
 * @author limingwei
 */
@Getter
@Setter
@Slf4j
public class AbstractPhoneEventFilter implements Filter {
    /**
     * 默认
     */
    private BudoPhoneEventListener budoPhoneEventListener;

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        log.info("#29 init, filterConfig=" + filterConfig + ", this=" + this);
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        log.info("#34 doFilter, request=" + request + ", response=" + response + ", chain=" + chain + ", this=" + this);
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {
        log.info("#40 destroy, this=" + this);
    }
}